Motion.SetAxisSecondEncoderCountsPerUnit method
Sets the conversion ratio of the user-defined position unit to the count (pulse) unit used by an axis for the secondary encoder.
Namespace: IntervalZero.KINGSTAR.Local.Api
Assembly: IntervalZero.KINGSTAR.Local.Api (in IntervalZero.KINGSTAR.Local.dll) Version: 4.4.0.0
Syntax
public KsError SetAxisSecondEncoderCountsPerUnit(
int Index,
double Numerator,
double Denominator,
bool Reverse
)
Public Function SetAxisSecondEncoderCountsPerUnit(
Index As Integer,
Numerator As Double,
Denominator As Double,
Reverse As Boolean
) As KsError
Parameters
Index
Type: int
The index of an axis. Indexes are zero based. Aliases affect this parameter.
Numerator
Type: double
Converts the drive unit to the user unit. For example, if the device is an encoder, typically the numerator is the resolution of the encoder.
Denominator
Type: double
Converts the drive unit to the user unit. For example, if you're using degree, the denominator will be 360 since there are 360 degrees in one revolution.
The following is an example of unit conversion:
angle: The angle you want.
resolution: The encoder resolution.
360: The degrees in a revolution.
position: The position.
Reverse
Type: bool
Reverses the direction of the axis.
Return value
A return code of a method.
Remarks
- Used to replace the count unit of the axis with a user unit. This method can only be used when the axis is disabled.
- After sending this method, you need to use EnableAxisUnitConversion so your unit takes effect.
Examples
N/A
See also